
malloc.o:     file format elf32-littlearm


Disassembly of section .text:

00000000 <immobility>:
#include <stdlib.h>
#include <string.h>


int immobility()
{
   0:	e92d4800 	push	{fp, lr}
   4:	e28db004 	add	fp, sp, #4
   8:	e24dd010 	sub	sp, sp, #16
	int *p;
	int d;
	int i;

	scanf("%d", &d);
   c:	e24b3010 	sub	r3, fp, #16 ; d address
  10:	e1a01003 	mov	r1, r3
  14:	e59f00bc 	ldr	r0, [pc, #188]	; d8 <immobility+0xd8>  parameter
  18:	ebfffffe 	bl	0 <scanf>
	p = (int*)malloc(sizeof(int) * d);
  1c:	e51b3010 	ldr	r3, [fp, #-16] ; r3 = d
  20:	e1a03103 	lsl	r3, r3, #2     ; r3 = d << 2
  24:	e1a00003 	mov	r0, r3         ; r0 = d << 2
  28:	ebfffffe 	bl	0 <malloc>
  2c:	e1a03000 	mov	r3, r0  ; r3 = malloc return value
  30:	e50b300c 	str	r3, [fp, #-12] ; save return value address ----> p

	for (i = 0; i < d; i++) {
  34:	e3a03000 	mov	r3, #0
  38:	e50b3008 	str	r3, [fp, #-8] ; i 
  3c:	ea000009 	b	68 <immobility+0x68>
		*(p + i) = i + 1;
  40:	e51b3008 	ldr	r3, [fp, #-8] ; r3 = i
  44:	e1a03103 	lsl	r3, r3, #2    ; r3 = i<<2
  48:	e51b200c 	ldr	r2, [fp, #-12] ; p ---> malloc request memory
  4c:	e0823003 	add	r3, r2, r3     ; r3 = p + i<<2
  50:	e51b2008 	ldr	r2, [fp, #-8]  ; r2 = i
  54:	e2822001 	add	r2, r2, #1     ; r2 = i+1
  58:	e5832000 	str	r2, [r3]       ; *(p+i<<2) = i+1
	int i;

	scanf("%d", &d);
	p = (int*)malloc(sizeof(int) * d);  

	for (i = 0; i < d; i++) {
  5c:	e51b3008 	ldr	r3, [fp, #-8] ; i 
  60:	e2833001 	add	r3, r3, #1    ; i + 1
  64:	e50b3008 	str	r3, [fp, #-8] ; i
  68:	e51b3010 	ldr	r3, [fp, #-16] ; d
  6c:	e51b2008 	ldr	r2, [fp, #-8]  ; i
  70:	e1520003 	cmp	r2, r3
  74:	bafffff1 	blt	40 <immobility+0x40>
		*(p + i) = i + 1;
	}

	for (i = 0; i < d; i++) {
  78:	e3a03000 	mov	r3, #0
  7c:	e50b3008 	str	r3, [fp, #-8] ; i
  80:	ea00000a 	b	b0 <immobility+0xb0>
		printf("\t%d\n", *(p + i));
  84:	e51b3008 	ldr	r3, [fp, #-8] ; i
  88:	e1a03103 	lsl	r3, r3, #2    ; i << 2
  8c:	e51b200c 	ldr	r2, [fp, #-12] ; r2 = p ---> malloc request memory
  90:	e0823003 	add	r3, r2, r3     ; r3 = p + i<<2
  94:	e5933000 	ldr	r3, [r3]       ; r3 = *(p+i<<2)
  98:	e1a01003 	mov	r1, r3         ; r1 = *(p+i<<2)
  9c:	e59f0038 	ldr	r0, [pc, #56]	; dc <immobility+0xdc>
  a0:	ebfffffe 	bl	0 <printf>

	for (i = 0; i < d; i++) {
		*(p + i) = i + 1;
	}

	for (i = 0; i < d; i++) {
  a4:	e51b3008 	ldr	r3, [fp, #-8]
  a8:	e2833001 	add	r3, r3, #1
  ac:	e50b3008 	str	r3, [fp, #-8]
  b0:	e51b3010 	ldr	r3, [fp, #-16]
  b4:	e51b2008 	ldr	r2, [fp, #-8]
  b8:	e1520003 	cmp	r2, r3
  bc:	bafffff0 	blt	84 <immobility+0x84>
		printf("\t%d\n", *(p + i));
	}

	free(p);
  c0:	e51b000c 	ldr	r0, [fp, #-12] ; p ---> malloc request memory
  c4:	ebfffffe 	bl	0 <free>

	return 0;
  c8:	e3a03000 	mov	r3, #0
}
  cc:	e1a00003 	mov	r0, r3
  d0:	e24bd004 	sub	sp, fp, #4
  d4:	e8bd8800 	pop	{fp, pc}
  d8:	00000000 	.word	0x00000000
  dc:	00000004 	.word	0x00000004

000000e0 <dynamic>:

int dynamic()
{
  e0:	e92d4800 	push	{fp, lr}
  e4:	e28db004 	add	fp, sp, #4
  e8:	e24dd008 	sub	sp, sp, #8
	int *p;
	int i;

	for (i = 0; i < 10; i++) {
  ec:	e3a03000 	mov	r3, #0
  f0:	e50b300c 	str	r3, [fp, #-12] ; i
  f4:	ea00000a 	b	124 <dynamic+0x44>
		p = (int *)malloc(sizeof(int));
  f8:	e3a00004 	mov	r0, #4
  fc:	ebfffffe 	bl	0 <malloc>
 100:	e1a03000 	mov	r3, r0  ; return address
 104:	e50b3008 	str	r3, [fp, #-8] ; fp-8 = malloc return address 
		*p = i + 11;
 108:	e51b300c 	ldr	r3, [fp, #-12] ; r3 = i
 10c:	e283200b 	add	r2, r3, #11    ; r2 = i + 11
 110:	e51b3008 	ldr	r3, [fp, #-8]  ; p
 114:	e5832000 	str	r2, [r3]       ; *p = i+11
int dynamic()
{
	int *p;
	int i;

	for (i = 0; i < 10; i++) {
 118:	e51b300c 	ldr	r3, [fp, #-12]
 11c:	e2833001 	add	r3, r3, #1
 120:	e50b300c 	str	r3, [fp, #-12]
 124:	e51b300c 	ldr	r3, [fp, #-12]
 128:	e3530009 	cmp	r3, #9
 12c:	dafffff1 	ble	f8 <dynamic+0x18>
		p = (int *)malloc(sizeof(int));
		*p = i + 11;
	}

	for (i = 0; i < 10; i++) {
 130:	e3a03000 	mov	r3, #0
 134:	e50b300c 	str	r3, [fp, #-12]
 138:	ea00000a 	b	168 <dynamic+0x88>
		printf("\t%d\n", *(p + i));
 13c:	e51b300c 	ldr	r3, [fp, #-12] ; i
 140:	e1a03103 	lsl	r3, r3, #2     ; i<<2
 144:	e51b2008 	ldr	r2, [fp, #-8]  ; r2 = fp-8 = p ---> malloc request address
 148:	e0823003 	add	r3, r2, r3     ; r3 = p + i<<2
 14c:	e5933000 	ldr	r3, [r3]       ; *(p+i<<2)
 150:	e1a01003 	mov	r1, r3         ; r1 = *(p+i<<2)
 154:	e59f0024 	ldr	r0, [pc, #36]	; 180 <dynamic+0xa0>
 158:	ebfffffe 	bl	0 <printf>
	for (i = 0; i < 10; i++) {
		p = (int *)malloc(sizeof(int));
		*p = i + 11;
	}

	for (i = 0; i < 10; i++) {
 15c:	e51b300c 	ldr	r3, [fp, #-12]
 160:	e2833001 	add	r3, r3, #1
 164:	e50b300c 	str	r3, [fp, #-12]
 168:	e51b300c 	ldr	r3, [fp, #-12]
 16c:	e3530009 	cmp	r3, #9
 170:	dafffff1 	ble	13c <dynamic+0x5c>
		printf("\t%d\n", *(p + i));
	}
}
 174:	e1a00003 	mov	r0, r3
 178:	e24bd004 	sub	sp, fp, #4
 17c:	e8bd8800 	pop	{fp, pc}
 180:	00000004 	.word	0x00000004

00000184 <main>:

int main()
{
 184:	e92d4800 	push	{fp, lr}
 188:	e28db004 	add	fp, sp, #4
	//immobility();
	dynamic();
 18c:	ebfffffe 	bl	e0 <dynamic>

	return 0;
 190:	e3a03000 	mov	r3, #0
}
 194:	e1a00003 	mov	r0, r3
 198:	e8bd8800 	pop	{fp, pc}
